<template>
    <div class="container">
        <div class="list" @click="selectMenu" :class="{active:isActive1}" data-id="1">
            <div class="list-child">
                <i class="iconfont icon-shouye1"></i>
            </div>
            <div class="list-child1">
                首页
            </div>
        </div>
        <div class="list" @click="selectMenu" :class="{active:isActive2}" data-id="2">
            <div class="list-child">
                <i class="iconfont icon-kehuguanli"></i>
            </div>
            <div class="list-child1">
                客户
            </div>
        </div>
        <div class="list" @click="selectMenu" :class="{active:isActive3}" data-id="3">
            <div class="list-child">
                <i class="iconfont icon-shijian"></i>
            </div>
            <div class="list-child1">
                待办
            </div>
        </div>
        <div class="list" @click="selectMenu" :class="{active:isActive4}" data-id="4">
            <div class="list-child">
                <i class="iconfont icon-yonghu"></i>
            </div>
            <div class="list-child1">
                我的
            </div>
        </div>
    </div>
</template>

<script>
    export default {
        name: "foot",
        data(){
            return{
                isActive1:true,
                isActive2:false,
                isActive3:false,
                isActive4:false,
            }
        },
        methods:{
            selectMenu(e){
                let id = e.currentTarget.dataset.id;
                switch (id){
                    case '1':
                        console.log(id);
                        this.isActive1 = true;
                        this.isActive2 = false;
                        this.isActive3 = false;
                        this.isActive4 = false;
                        break;
                    case '2':
                        this.isActive1 = false;
                        this.isActive2 = true;
                        this.isActive3 = false;
                        this.isActive4 = false;
                        break;
                    case '3':
                        this.isActive1 = false;
                        this.isActive2 = false;
                        this.isActive3 = true;
                        this.isActive4 = false;
                        break;
                    case '4':
                        this.isActive1 = false;
                        this.isActive2 = false;
                        this.isActive3 = false;
                        this.isActive4 = true;
                        break;
                }
            }
        }
    }
</script>

<style scoped>
    .container{
        width: 100%;
        height: 4rem;
        position: fixed;
        bottom: 0;
        left: 0;
        display: flex;
        justify-content: space-between;
        z-index: 999;
        background-color: white;
    }
    .container > .list{
        width:25%;
        height:100%;
        line-height: 3rem;
    }
    .container > .list:focus{
        color:#56b176;
    }
    .container > .list > .list-child{
        height: 50%;
    }
    .container > .list > .list-child1{
        height: 50%;
        font-size: 0.7rem;
        line-height: 2rem;
    }
    .container > .list > .list-child > i{
        font-size: 1.5rem;
    }
    .active{
        color:#45b36a;
    }

</style>